<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>数据系统</title>
    <script src="{{url_for('static', path='/layui/echarts.min.js')}}"></script>
    <script src="{{url_for('static', path='/layui/layui.js')}}"></script>
    <script src="{{url_for('static', path='/layui/jquery-3.5.1.min.js')}}"></script>
    <link rel="stylesheet" href="{{url_for('static', path='/layui/css/layui.css')}}" media="all">
</head>
<body>
<form id="form1" class="layui-form" action="">
    <div class="layui-form-item layui-form-text" style="padding-top: 20px;margin:0 auto;text-align: center;">
        <div class="layui-container">
            <div class="layui-row">
                <div class="layui-col-md8">
                    <div class="layui-inline" style="width: 300px;">
                        <label class="layui-form-label" style="width: 50px;">用户</label>
                        <div class="layui-input-inline" style="width: 200px;">
                            <input type="text" name="userid" placeholder="请输入用户ID" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline" style="width: 300px;">
                        <label class="layui-form-label" style="width: 50px;">日期</label>
                        <div class="layui-input-inline" style="width: 200px;">
                            <input type="text" name="date" placeholder="请输入查询日期" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-col-md4">
                    <div class="layui-input-inline">
                        <button type="submit" class="layui-btn" lay-submit="" lay-filter="formDemo">立即提交</button>
                    </div>
                    <div class="layui-input-inline">
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

</form>
<hr class="layui-border-orange">
<div id="body" style="margin:0 auto;text-align: center;vertical-align:middle;line-height: 500px;color: #8D8D8D">
    <h1>请在上方输入用户ID和查询日期查询用户轨迹，谢谢！！！</h1>
</div>
</body>
<script>
    layui.use('form', function () {
        var form = layui.form;
        form.on('submit(formDemo)', function (data) {
            var articleFrom = JSON.stringify(data.field);
            console.log(articleFrom)
            $.ajax({
                type: "POST",
                url: "/analysis/query/result",
                contentType: "application/json",
                data: articleFrom,
                // dataType: "JSON",
                success: function (data) {
                    $("#body").html(data)
                }
            });
            return false;
        });
    });
</script>
</html>
